import { Module } from 'vuex';
import { Local } from '/@/utils/storage';
// 此处加上 `.ts` 后缀报错，具体原因不详
import { CustomeState, RootStateTypes } from '/@/store/interface/index';

const CustomeModule: Module<CustomeState , RootStateTypes> = {
	namespaced: true,
	state: {
		customs: {}
	},
	mutations: {
		getCustoms(state: any, data: object) {
			state.customs = data;
			Local.set('customs', state.customs);
		}
	},
	actions: {
		async setCustoms({ commit }, data: object) {
			commit('getCustoms', data);
		}
	},
};

export default CustomeModule;
